package com.book.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.book.bean.Book;
import com.book.dao.IBookDao;

@Transactional
@Service
public class BookService implements IBookService {

	public void setBookDao(IBookDao bookDao) {
		this.bookDao = bookDao;
	}
	
	@Override
	public List<Book> getAllBook() {
		return bookDao.getAllBook();
	}

	@Override
	public Book getBookById(String book_id) {
		return bookDao.getBookById(book_id);
	}
	
	@Override
	public List<Book> getBookByName(String name) {
		return bookDao.getBookByName(name);
	}

	@Override
	public List<Book> getBookByPublisher(String publisher) {
		return bookDao.getBookByPublisher(publisher);
	}

	@Override
	public List<Book> getBookByAuthor(String author) {
		return bookDao.getBookByAuthor(author);
	}

	@Override
	public List<Book> getBookByKeyword(String keyword) {
		return bookDao.getBookByKeyword(keyword);
	}
	
	@Override
	public List<Book> getBookByType(String type) {
		return bookDao.getBookByType(type);
	}

	@Resource
	private IBookDao bookDao;
}
